<template>
  <div>
    <Chart :cdata="cdata"/>
  </div>
</template>

<script>
import Chart from './chart.vue'
import {getMapData} from "@/axios/api"

let data = null;
export default {
  data() {
    return {
      cdata: {
        // X轴坐标
        category: [],
        // 新增本土
        lineData: [],
        // 新增境外
        barData: []
      }
    };
  },
  components: {
    Chart,
  },
  mounted() {
    this.getEpi()
  },
  methods: {
    async getEpi() {
      data = await getMapData().then(res => res.data)
      this.cdata.category = data[2] // x轴数据
      this.cdata.lineData = data[0] // 新增本土
      this.cdata.barData = data[1] // 新增境外
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
